﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.Calibration.ExceptionToString
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using DnProcessSimulateCommands.Calibration.Resources;
using System;
using System.Globalization;
using System.Windows.Data;


namespace DnProcessSimulateCommands.Calibration;

public class ExceptionToString : IValueConverter
{
  public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  {
    switch ((TxCalibrationTransformationException) value)
    {
      case TxCalibrationTransformationException.NoImprovement:
        return (object) CalibrationResources.CALIBRATION_ERROR_NO_IMPROVEMENT;
      case TxCalibrationTransformationException.ShouldGetAtLeast3Pairs:
        return (object) CalibrationResources.CALIBRATION_ERROR_AT_LEAST_THREE_PAIRS;
      case TxCalibrationTransformationException.VirtualPointsAreCollinear:
        return (object) CalibrationResources.CALIBRATION_ERROR_VIRTUAL_LOCATIONS_COLLINEAR;
      case TxCalibrationTransformationException.ActualPointsAreCollinear:
        return (object) CalibrationResources.CALIBRATION_ERROR_ACTUAL_LOCATIONS_COLLINEAR;
      case TxCalibrationTransformationException.FailedNoConvergenceAfter30Iterations:
        return (object) CalibrationResources.CALIBRATION_ERROR_NO_CONVERGENCE;
      case TxCalibrationTransformationException.FailedNoisyOrColinearInputPoints:
        return (object) CalibrationResources.CALIBRATION_ERROR_NOISY_INPUT;
      case TxCalibrationTransformationException.FailedNonOrthonormalResult:
        return (object) CalibrationResources.CALIBRATION_ERROR_NON_ORTHONOMAL_TRANSFORMATION;
      case TxCalibrationTransformationException.FailedMirrorTransformation:
        return (object) CalibrationResources.CALIBRATION_ERROR_MIRROR_TRANSFORMATION;
      case TxCalibrationTransformationException.TheListsLenAreNotEqual:
        return (object) CalibrationResources.CALIBRATION_ERROR_LISTS_NOT_EQUAL;
      default:
        return (object) CalibrationResources.CALIBRATION_ERROR_NO_VALID_CALIBRATION;
    }
  }

  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  {
    throw new NotImplementedException();
  }
}
